@use '@scss/common.scss' as *;

$curve: cubic-bezier(0.165, 0.84, 0.44, 1);

.mobileNav {
  display: none;
  visibility: hidden;
  width: 100%;
  -webkit-perspective: 1000;
  -webkit-backface-visibility: hidden;

  @include mobile-header-break {
    display: block;
    visibility: visible;
  }
}

.logo {
  position: relative;
  top: -2px;

  & svg {
    height: 1.25rem;
    width: auto;
  }
}

.menuBarContainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;

  & a {
    color: var(--theme-elevation-900);
  }
}

.descriptionLinks {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 0;
}

.descriptionLink {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.icons {
  display: flex;
  align-items: center;
  gap: 1.25rem;

  a {
    text-decoration: none;
  }

  & path,
  & rect {
    color: var(--theme-elevation-900);
  }
}

.cloudNewProject {
  display: flex;
  align-items: center;

  > * {
    text-decoration: none;
    margin-right: 1rem;
    line-height: 1;
  }

  & > *:last-child {
    margin-right: 0;
  }

  @include small-break {
    display: none;
    visibility: hidden;
  }
}

.mobileAvatar {
  @include mobile-header-break {
    margin-left: 1rem;
  }
}

.searchToggler {
  all: unset;
  cursor: pointer;
  margin-right: 0.5rem;
}

.modalToggler {
  all: unset;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-self: center;

  & svg {
    & > * {
      transition: all var(--trans-default) ease;
    }
  }
}

.hamburgerOpen {
  & svg {
    & > * {
      transition: all var(--trans-default) ease;
    }

    & rect {
      &:nth-child(1) {
        transform: translateX(5px) rotate(45deg);
        top: 0;
        transform-origin: top left;
      }

      &:nth-child(2) {
        opacity: 0;
      }

      &:nth-child(3) {
        bottom: 0;
        transform: translateX(5px) rotate(-45deg);
        transform-origin: bottom left;
      }
    }
  }
}

.modalBlur {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--theme-bg);
  opacity: 1;
  z-index: -1;
}

.mobileMenuModal {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  max-height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  margin-top: var(--page-padding-top);
  display: none;
  visibility: hidden;
  position: relative;
  background-color: transparent;

  ::-webkit-scrollbar {
    opacity: transparent;
  }

  @include mobile-header-break {
    display: block;
    visibility: visible;
  }
}

.mobileMenuWrap {
  position: relative;
  height: 100%;
  max-height: 100%;
  padding-top: var(--gutter-h);
}

.mobileMenuItems {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  z-index: 1;
}

.mobileSubMenu {
  z-index: 2;
  background-color: var(--theme-bg);
}

.crosshairTopLeft {
  transform: translate(-50%, -50%);
  top: 0;
}

.crosshairBottomLeft {
  transform: translate(-50%, 50%);
  bottom: 0;
}

.mobileMenuItem {
  font-family: var(--font-body);
  @include btnReset;
  @include h4;

  & {
    letter-spacing: -0.02em;
    padding: 1.25rem;
    font-weight: 500;
    margin: 0;
    text-decoration: none;
    color: var(--theme-text);
    width: 100%;
    border-left: 1px solid var(--theme-border-color);
    border-bottom: 1px solid var(--theme-border-color);
    align-items: center;
    display: flex;
    justify-content: space-between;
    background-color: var(--theme-bg);
  }

  &:first-child {
    border-top: 1px solid var(--theme-border-color);
  }

  &:hover,
  &:focus {
    text-decoration: none;
  }

  @include mobile-header-break {
    margin: 0;
  }
}

.backButton {
  @include btnReset;
  & {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    position: relative;
    border-top: 1px solid var(--theme-border-color);
  }
}

.directLink {
  text-decoration: none;
}

.subMenuItems {
  position: relative;
  display: flex;
  flex-direction: column;

  & > * {
    position: relative;
    border: 1px solid var(--theme-border-color);
    border-top: 0;
    padding: 1.25rem;
    background-color: var(--theme-bg);
    z-index: 1;
  }

  & a:focus {
    text-decoration: none;
  }

  &:first-child {
    border-top: 1px solid var(--theme-border-color);
  }
}

.crosshair {
  z-index: 3;
  opacity: 0.5;
  height: 0;
  position: absolute;
  left: 0;
  pointer-events: none;
  border: none;
  padding: 0;
}

.linkWrap {
  position: relative;
}

.subMenuItem {
  text-decoration: none;
  border-top: 1px solid var(--theme-border-color);
}

.subMenuWrap {
  position: relative;
  padding: 1rem 0;
  top: 0;
  bottom: 0;
  min-height: 100%;
}

.newProject {
  @include small-break {
    display: none;
  }
}

.defaultLink,
.listLabelWrap {
  @include btnReset;
  & {
    display: flex;
    text-decoration: none;
  }
}

.featuredLinkWrap {
  @include btnReset;
  & {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
  }
}

.featuredLinks {
  font-size: var(--font-size-body);
  text-decoration: none;
  display: flex;
  gap: 0.75rem;
  align-items: center;

  & svg {
    width: 0.85rem;
    height: 0.85rem;
  }
}

.linkArrow {
  margin-left: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
}

.listLabelWrap {
  flex-direction: column;
  width: 100%;
}

.listLabel {
  @include h5;
  & {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.5rem 0;
  }
}

.listWrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.link {
  width: 47%;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.itemDescription {
  @include small;
  & {
    line-height: 1.5;
  }
}

.tag {
  @include h6;
  & {
    margin: 0 0 1.5rem 0;
    font-weight: normal;
    text-transform: uppercase;
  }
}

.github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  svg {
    width: 1.25rem;
  }

  @include small-break {
    display: none;
    visibility: hidden;
  }

  &:hover {
    opacity: 0.8;
  }
}

a.button {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  color: var(--theme-elevation-0);
  background: var(--theme-elevation-1000);
  border: 1px solid var(--theme-elevation-1000);
  border-radius: 4px;
}
